package com.jiang;

import com.jiang.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppForInstanceBook {
    public static void main(String[] args) {
        //获取IOC容器
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
       
        //获取bean
        BookService bookService = (BookService) applicationContext.getBean("bookService");
        bookService.save(); 
       applicationContext.registerShutdownHook();
//        applicationContext.close();
    }
}
